package com.fort.teachermanagementsys.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fort.teachermanagementsys.entity.Schedule;
import com.fort.teachermanagementsys.mapper.ScheduleMapper;
import com.fort.teachermanagementsys.service.ScheduleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ScheduleServiceImpl extends ServiceImpl<ScheduleMapper, Schedule> implements ScheduleService {

    @Transactional
    @Override
    public Schedule addSchedule(Schedule schedule) {
        save(schedule);
        return schedule;
    }

    @Override
    public Page<Schedule> page(Page<Schedule> page, LambdaQueryWrapper<Schedule> queryWrapper) {
        return baseMapper.selectPage(page, queryWrapper);
    }
}
